home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
speak.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-26
|
2KB
|
70 lines
#include <exec/types.h>
#include <exec/memory.h>
#include <devices/narrator.h>
struct Library *TranslatorBase;
struct narrator_rb *io;
struct MsgPort *port;
LONG dev=-1L;
UBYTE *mem;
UBYTE Channels[4]={3,5,10,12};
VOID Say(text)
UBYTE *text;
{
io->rate=DEFRATE;
io->pitch=DEFPITCH;
io->mode=0;
io->sex=0;
io->ch_masks=&Channels;
io->nm_masks=4;
io->volume=64;
io->sampfreq=28000;
Translate(text,strlen(text),mem,1024);
io->message.io_Command=CMD_WRITE;
io->message.io_Data=mem;
io->message.io_Length=strlen(mem);
DoIO(io);
}
VOID main()
{
port=CreatePort("Speak 1.0 Narrator Port",0);
if(port!=NULL)
{
io=CreateExtIO(port,sizeof(struct narrator_rb));
if(io!=NULL)
{
dev=OpenDevice("narrator.device",0,io,0);
if(dev==0)
{
TranslatorBase=OpenLibrary("translator.library",0);
if(TranslatorBase!=NULL)
{
mem=AllocMem(1024,MEMF_CLEAR|MEMF_PUBLIC);
if(mem!=NULL)
{
puts("------------ Speak -------------");
Say("l p t 1 control display opened");
Say("~~~~~ 1234567890 []{} ~~~~~");
Say("commodore amiga 2thousand");
Say("test test test");
Say("a t keyboard");
puts("--------------------------------");
FreeMem(mem,1024);
}
CloseLibrary(TranslatorBase);
}
CloseDevice(io);
}
DeleteExtIO(io);
}
DeletePort(port);
}
puts("Ende");
}